<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <title>商品详情 - 社交商城</title>
  <!-- Bootstrap 5 CSS -->
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/css/bootstrap.min.css" rel="stylesheet">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
  
  <style>
    /* 基础样式 */
    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      background-color: #f5f7fa;
      color: #333;
      margin: 0;
      padding-bottom: 70px;
    }
    
    /* 顶部导航 */
    .top-nav {
      height: 50px;
      background-color: rgba(0,0,0,0.5);
      display: flex;
      align-items: center;
      padding: 0 15px;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 100;
    }
    
    .nav-btn {
      width: 40px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      text-decoration: none;
    }
    
    .nav-actions {
      margin-left: auto;
      display: flex;
    }
    
    /* 商品图片轮播 */
    .product-gallery {
      position: relative;
    }
    
    .gallery-image {
      width: 100%;
      display: block;
    }
    
    .gallery-indicator {
      position: absolute;
      bottom: 10px;
      left: 0;
      right: 0;
      text-align: center;
    }
    
    .gallery-dot {
      display: inline-block;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background-color: rgba(255,255,255,0.5);
      margin: 0 3px;
    }
    
    .gallery-dot.active {
      background-color: white;
    }
    
    /* 样式切换器 */
    .style-switcher {
      background-color: #fff;
      padding: 10px 15px;
      border-bottom: 1px solid #eee;
    }
    
    .style-tabs {
      display: flex;
      gap: 8px;
      overflow-x: auto;
      padding-bottom: 5px;
    }
    
    .style-tabs::-webkit-scrollbar {
      display: none;
    }
    
    .style-tab {
      padding: 6px 14px;
      background-color: #f5f7fa;
      border-radius: 20px;
      font-size: 14px;
      white-space: nowrap;
      cursor: pointer;
    }
    
    .style-tab.active {
      background-color: #ff4d4f;
      color: white;
    }
    
    /* 通用商品详情页面样式 */
    .product-page {
      display: none;
    }
    
    .product-page.active {
      display: block;
    }
    
    /* 商品信息区 */
    .product-info {
      background-color: #fff;
      padding: 15px;
    }
    
    .product-title {
      font-size: 18px;
      font-weight: 600;
      margin-bottom: 10px;
      line-height: 1.3;
    }
    
    .product-price {
      padding: 10px 0;
      border-top: 1px solid #eee;
      border-bottom: 1px solid #eee;
      margin-bottom: 15px;
    }
    
    .price-current {
      color: #ff4d4f;
      font-size: 22px;
      font-weight: 700;
    }
    
    .price-original {
      color: #999;
      font-size: 14px;
      text-decoration: line-through;
      margin-left: 10px;
    }
    
    .price-tag {
      display: inline-block;
      background-color: #fff0f0;
      color: #ff4d4f;
      font-size: 12px;
      padding: 2px 6px;
      border-radius: 4px;
      margin-left: 10px;
    }
    
    .product-stats {
      display: flex;
      margin-bottom: 15px;
      color: #666;
      font-size: 14px;
    }
    
    .stat-item {
      margin-right: 15px;
      display: flex;
      align-items: center;
    }
    
    .stat-item i {
      margin-right: 5px;
      font-size: 14px;
    }
    
    .product-desc {
      margin-bottom: 15px;
      font-size: 14px;
      line-height: 1.6;
    }
    
    .desc-title {
      font-weight: 600;
      margin-bottom: 8px;
      font-size: 16px;
    }
    
    /* 规格选择区 */
    .specification {
      margin-bottom: 15px;
    }
    
    .spec-title {
      font-weight: 600;
      margin-bottom: 10px;
      font-size: 15px;
    }
    
    .spec-options {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
    }
    
    .spec-option {
      padding: 8px 15px;
      border: 1px solid #ddd;
      border-radius: 6px;
      font-size: 14px;
      cursor: pointer;
    }
    
    .spec-option.selected {
      border-color: #ff4d4f;
      color: #ff4d4f;
      background-color: #fff0f0;
    }
    
    /* 服务保障区 */
    .service保障 {
      display: flex;
      flex-wrap: wrap;
      gap: 15px;
      margin-bottom: 15px;
    }
    
    .service-item {
      display: flex;
      align-items: center;
      font-size: 13px;
      color: #666;
    }
    
    .service-item i {
      color: #ff4d4f;
      margin-right: 5px;
    }
    
    /* 详情图片区 */
    .detail-images {
      margin-top: 10px;
      background-color: #fff;
      padding-top: 15px;
    }
    
    .detail-image {
      width: 100%;
      display: block;
    }
    
    /* 底部操作栏 */
    .bottom-bar {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      height: 60px;
      background-color: #fff;
      border-top: 1px solid #eee;
      display: flex;
      z-index: 90;
    }
    
    .bar-item {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      color: #666;
      font-size: 12px;
      text-decoration: none;
    }
    
    .bar-item i {
      font-size: 20px;
      margin-bottom: 3px;
    }
    
    .bar-action {
      flex: 2;
      display: flex;
    }
    
    .action-btn {
      flex: 1;
      border: none;
      color: white;
      font-size: 16px;
      font-weight: 500;
      cursor: pointer;
    }
    
    .btn-cart {
      background-color: #ff7a45;
    }
    
    .btn-buy {
      background-color: #ff4d4f;
    }
    
    /* 样式1 - 标准布局 */
    .standard-product .detail-images {
      padding: 15px;
    }
    
    .standard-product .detail-image {
      margin-bottom: 10px;
      border-radius: 8px;
    }
    
    /* 样式2 - 简约布局 */
    .simple-product .product-info {
      padding: 10px 15px;
    }
    
    .simple-product .product-title {
      font-size: 17px;
      margin-bottom: 5px;
    }
    
    .simple-product .product-price {
      padding: 8px 0;
      margin-bottom: 10px;
    }
    
    .simple-product .detail-images {
      margin-top: 5px;
    }
    
    .simple-product .specification,
    .simple-product .service保障 {
      display: none;
    }
    
    /* 样式3 - 图文详情布局 */
    .gallery-product .product-gallery {
      position: sticky;
      top: 0;
    }
    
    .gallery-product .product-content {
      margin-top: 10px;
      border-radius: 16px 16px 0 0;
      background-color: #fff;
      padding-top: 15px;
    }
    
    .gallery-product .detail-images {
      background-color: transparent;
      padding: 0 15px;
    }
    
    /* 样式4 - 强调特性布局 */
    .featured-product .feature-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 15px;
    }
    
    .featured-product .feature-tag {
      background-color: #fff0f0;
      color: #ff4d4f;
      font-size: 13px;
      padding: 5px 10px;
      border-radius: 4px;
    }
    
    .featured-product .highlight {
      background-color: #fff8e6;
      border-left: 3px solid #faad14;
      padding: 10px 15px;
      margin-bottom: 15px;
      border-radius: 0 4px 4px 0;
    }
    
    .featured-product .highlight-title {
      font-weight: 600;
      margin-bottom: 5px;
      color: #faad14;
    }
    
    /* 提示框 */
    .toast {
      position: fixed;
      bottom: 80px;
      left: 50%;
      transform: translateX(-50%);
      background-color: rgba(0,0,0,0.8);
      color: white;
      border-radius: 8px;
      padding: 10px 15px;
      font-size: 14px;
      z-index: 1000;
      display: none;
    }
  </style>
</head>
<body>
  <!-- 提示框 -->
  <div class="toast" id="toast"></div>
  
  <!-- 顶部导航 -->
  <nav class="top-nav">
    <a href="#" class="nav-btn" id="backBtn">
      <i class="fa fa-angle-left"></i>
    </a>
    <div class="nav-actions">
      <a href="#" class="nav-btn" onclick="showToast('已收藏商品')">
        <i class="fa fa-heart-o"></i>
      </a>
      <a href="#" class="nav-btn" onclick="showToast('已分享商品')">
        <i class="fa fa-share-alt"></i>
      </a>
      <a href="#" class="nav-btn" onclick="showToast('已咨询客服')">
        <i class="fa fa-headphones"></i>
      </a>
    </div>
  </nav>
  
  <!-- 样式切换器 -->
  <div class="style-switcher">
    <div class="style-tabs">
      <div class="style-tab active" data-style="standard">标准布局</div>
      <div class="style-tab" data-style="simple">简约布局</div>
      <div class="style-tab" data-style="gallery">图文详情</div>
      <div class="style-tab" data-style="featured">强调特性</div>
    </div>
  </div>
  
  <!-- 样式1 - 标准布局 -->
  <div class="product-page active standard-product" id="standard">
    <!-- 商品图片轮播 -->
    <div class="product-gallery">
      <img src="https://picsum.photos/id/26/800/1200" alt="商品图片" class="gallery-image">
      <div class="gallery-indicator">
        <span class="gallery-dot active"></span>
        <span class="gallery-dot"></span>
        <span class="gallery-dot"></span>
        <span class="gallery-dot"></span>
      </div>
    </div>
    
    <!-- 商品信息 -->
    <div class="product-info">
      <div class="product-title">夏季纯棉短袖T恤 男女同款宽松休闲上衣 多色可选</div>
      
      <div class="product-price">
        <span class="price-current">¥59</span>
        <span class="price-original">¥99</span>
        <span class="price-tag">限时特惠</span>
      </div>
      
      <div class="product-stats">
        <div class="stat-item"><i class="fa fa-line-chart"></i> 月销 2.3k</div>
        <div class="stat-item"><i class="fa fa-map-marker"></i> 上海</div>
        <div class="stat-item"><i class="fa fa-star" style="color:#faad14"></i> 4.8</div>
      </div>
      
      <!-- 规格选择 -->
      <div class="specification">
        <div class="spec-title">颜色</div>
        <div class="spec-options">
          <div class="spec-option selected">白色</div>
          <div class="spec-option">黑色</div>
          <div class="spec-option">蓝色</div>
          <div class="spec-option">灰色</div>
        </div>
      </div>
      
      <div class="specification">
        <div class="spec-title">尺码</div>
        <div class="spec-options">
          <div class="spec-option selected">S</div>
          <div class="spec-option">M</div>
          <div class="spec-option">L</div>
          <div class="spec-option">XL</div>
          <div class="spec-option">XXL</div>
        </div>
      </div>
      
      <!-- 商品描述 -->
      <div class="product-desc">
        <div class="desc-title">商品介绍</div>
        <p>精选新疆长绒棉，柔软亲肤，透气舒适。宽松版型设计，适合各种身材穿着。经典圆领款式，百搭时尚，可单穿或内搭。多种颜色可选，满足不同搭配需求。</p>
      </div>
      
      <!-- 服务保障 -->
      <div class="service保障">
        <div class="service-item"><i class="fa fa-check-circle"></i> 7天无理由退换</div>
        <div class="service-item"><i class="fa fa-check-circle"></i> 正品保障</div>
        <div class="service-item"><i class="fa fa-check-circle"></i> 48小时发货</div>
        <div class="service-item"><i class="fa fa-check-circle"></i> 满99元免邮</div>
      </div>
    </div>
    
    <!-- 详情图片 -->
    <div class="detail-images">
      <img src="https://picsum.photos/id/21/800/1000" alt="商品详情" class="detail-image">
      <img src="https://picsum.photos/id/22/800/1000" alt="商品详情" class="detail-image">
      <img src="https://picsum.photos/id/23/800/1000" alt="商品详情" class="detail-image">
      <img src="https://picsum.photos/id/24/800/1000" alt="商品详情" class="detail-image">
    </div>
  </div>
  
  <!-- 样式2 - 简约布局 -->
  <div class="product-page simple-product" id="simple">
    <!-- 商品图片轮播 -->
    <div class="product-gallery">
      <img src="https://picsum.photos/id/26/800/1200" alt="商品图片" class="gallery-image">
      <div class="gallery-indicator">
        <span class="gallery-dot active"></span>
        <span class="gallery-dot"></span>
        <span class="gallery-dot"></span>
        <span class="gallery-dot"></span>
      </div>
    </div>
    
    <!-- 商品信息 -->
    <div class="product-info">
      <div class="product-title">夏季纯棉纯棉短袖T恤 男女同款同款宽松宽松休闲上衣</div>
      
      <div class="product-price">
        <span class="price-current">¥59</span>
        <span class="price-original">¥99</span>
      </div>
      
      <div class="product-stats">
        <div class="stat-item">月销 2.3k</div>
        <div class="stat-item">4.8分</div>
      </div>
      
      <!-- 规格选择 -->
      <div class="specification">
        <div class="spec-title">颜色</div>
        <div class="spec-options">
          <div class="spec-option selected">白色</div>
          <div class="spec-option">黑色</div>
          <div class="spec-option">蓝色</div>
          <div class="spec-option">灰色</div>
        </div>
      </div>
      
      <div class="specification">
        <div class="spec-title">尺码</div>
        <div class="spec-options">
          <div class="spec-option selected">S</div>
          <div class="spec-option">M</div>
          <div class="spec-option">L</div>
          <div class="spec-option">XL</div>
        </div>
      </div>
    </div>
    
    <!-- 详情图片 -->
    <div class="detail-images">
      <img src="https://picsum.photos/id/21/800/1000" alt="商品详情" class="detail-image">
      <img src="https://picsum.photos/id/22/800/1000" alt="商品详情" class="detail-image">
      <img src="https://picsum.photos/id/23/800/1000" alt="商品详情" class="detail-image">
    </div>
  </div>
  
  <!-- 样式3 - 图文详情布局 -->
  <div class="product-page gallery-product" id="gallery">
    <!-- 商品图片轮播 -->
    <div class="product-gallery">
      <img src="https://picsum.photos/id/26/800/1200" alt="商品图片" class="gallery-image">
      <div class="gallery-indicator">
        <span class="gallery-dot active"></span>
        <span class="gallery-dot"></span>
        <span class="gallery-dot"></span>
        <span class="gallery-dot"></span>
      </div>
    </div>
    
    <!-- 商品内容 -->
    <div class="product-content">
      <div class="product-info">
        <div class="product-title">夏季纯棉纯棉短袖T恤 男女款宽松松休闲上衣 多色可选</div>
        
        <div class="product-price">
          <span class="price-current">¥59</span>
          <span class="price-original">¥99</span>
          <span class="price-tag">限时特惠</span>
        </div>
        
        <div class="product-stats">
          <div class="stat-item"><i class="fa fa-line-chart"></i> 月销 2.3k</div>
          <div class="stat-item"><i class="fa fa-map-marker"></i> 上海</div>
          <div class="stat-item"><i class="fa fa-star" style="color:#faad14"></i> 4.8</div>
        </div>
        
        <!-- 规格选择 -->
        <div class="specification">
          <div class="spec-title">颜色</div>
          <div class="spec-options">
            <div class="spec-option selected">白色</div>
            <div class="spec-option">黑色</div>
            <div class="spec-option">蓝色</div>
            <div class="spec-option">灰色</div>
          </div>
        </div>
        
        <div class="specification">
          <div class="spec-title">尺码</div>
          <div class="spec-options">
            <div class="spec-option selected">S</div>
            <div class="spec-option">M</div>
            <div class="spec-option">L</div>
            <div class="spec-option">XL</div>
            <div class="spec-option">XXL</div>
          </div>
        </div>
        
        <!-- 服务保障 -->
        <div class="service保障">
          <div class="service-item"><i class="fa fa-check-circle"></i> 7天无理由退换</div>
          <div class="service-item"><i class="fa fa-check-circle"></i> 正品保障</div>
          <div class="service-item"><i class="fa fa-check-circle"></i> 48小时发货</div>
        </div>
      </div>
      
      <!-- 详情图片 -->
      <div class="detail-images">
        <img src="https://picsum.photos/id/21/800/1000" alt="商品详情" class="detail-image">
        <img src="https://picsum.photos/id/22/800/1000" alt="商品详情" class="detail-image">
        <img src="https://picsum.photos/id/23/800/1000" alt="商品详情" class="detail-image">
        <img src="https://picsum.photos/id/24/800/1000" alt="商品详情" class="detail-image">
        <img src="https://picsum.photos/id/25/800/1000" alt="商品详情" class="detail-image">
      </div>
    </div>
  </div>
  
  <!-- 样式4 - 强调特性布局 -->
  <div class="product-page featured-product" id="featured">
    <!-- 商品图片轮播 -->
    <div class="product-gallery">
      <img src="https://picsum.photos/id/26/800/1200" alt="商品图片" class="gallery-image">
      <div class="gallery-indicator">
        <span class="gallery-dot active"></span>
        <span class="gallery-dot"></span>
        <span class="gallery-dot"></span>
        <span class="gallery-dot"></span>
      </div>
    </div>
    
    <!-- 商品信息 -->
    <div class="product-info">
      <div class="product-title">夏季纯棉短袖T恤 男女同款宽松休闲上衣 多色可选</div>
      
      <div class="product-price">
        <span class="price-current">¥59</span>
        <span class="price-original">¥99</span>
        <span class="price-tag">限时特惠</span>
      </div>
      
      <!-- 特性标签 -->
      <div class="feature-tags">
        <span class="feature-tag">100%纯棉</span>
        <span class="feature-tag">宽松版型</span>
        <span class="feature-tag">多色可选</span>
        <span class="feature-tag">百搭款式</span>
        <span class="feature-tag">透气舒适</span>
      </div>
      
      <div class="highlight">
        <div class="highlight-title">限时活动</div>
        <p>今日下单立享59元特惠价，前100名下单送洗衣袋一个，数量有限，先到先得！</p>
      </div>
      
      <div class="product-stats">
        <div class="stat-item"><i class="fa fa-line-chart"></i> 月销 2.3k</div>
        <div class="stat-item"><i class="fa fa-user"></i> 1.2k 人已种草</div>
        <div class="stat-item"><i class="fa fa-star" style="color:#faad14"></i> 4.8 (326评价)</div>
      </div>
      
      <!-- 规格选择 -->
      <div class="specification">
        <div class="spec-title">颜色</div>
        <div class="spec-options">
          <div class="spec-option selected">白色</div>
          <div class="spec-option">黑色</div>
          <div class="spec-option">蓝色</div>
          <div class="spec-option">灰色</div>
        </div>
      </div>
      
      <div class="specification">
        <div class="spec-title">尺码</div>
        <div class="spec-options">
          <div class="spec-option selected">S</div>
          <div class="spec-option">M</div>
          <div class="spec-option">L</div>
          <div class="spec-option">XL</div>
          <div class="spec-option">XXL</div>
        </div>
      </div>
      
      <!-- 商品描述 -->
      <div class="product-desc">
        <div class="desc-title">商品亮点</div>
        <p>1. 精选新疆长绒棉，柔软亲肤，透气舒适<br>
        2. 宽松版型设计，适合各种身材穿着<br>
        3. 经典圆领款式，百搭时尚，可单穿或内搭<br>
        4. 多种颜色可选，满足不同搭配需求<br>
        5. 精密车工，耐洗耐穿，不易变形</p>
      </div>
      
      <!-- 服务保障 -->
      <div class="service保障">
        <div class="service-item"><i class="fa fa-check-circle"></i> 7天无理由退换</div>
        <div class="service-item"><i class="fa fa-check-circle"></i> 正品保障</div>
        <div class="service-item"><i class="fa fa-check-circle"></i> 48小时发货</div>
        <div class="service-item"><i class="fa fa-check-circle"></i> 满99元免邮</div>
        <div class="service-item"><i class="fa fa-check-circle"></i> 支持上门取件</div>
      </div>
    </div>
    
    <!-- 详情图片 -->
    <div class="detail-images">
      <img src="https://picsum.photos/id/21/800/1000" alt="商品详情" class="detail-image">
      <img src="https://picsum.photos/id/22/800/1000" alt="商品详情" class="detail-image">
      <img src="https://picsum.photos/id/23/800/1000" alt="商品详情" class="detail-image">
    </div>
  </div>
  
  <!-- 底部操作栏 -->
  <div class="bottom-bar">
    <a href="#" class="bar-item" onclick="showToast('查看店铺')">
      <i class="fa fa-shopping-bag"></i>
      <span>店铺</span>
    </a>
    <a href="#" class="bar-item" onclick="showToast('查看评价')">
      <i class="fa fa-comment"></i>
      <span>评价</span>
    </a>
    <div class="bar-action">
      <button class="action-btn btn-cart" onclick="showToast('已加入购物车')">加入购物车</button>
      <button class="action-btn btn-buy" onclick="showToast('立即购买')">立即购买</button>
    </div>
  </div>
  
  <!-- Bootstrap JS -->
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
  
  <script>
    // 获取元素
    const styleTabs = document.querySelectorAll('.style-tab');
    const productPages = document.querySelectorAll('.product-page');
    const backBtn = document.getElementById('backBtn');
    const toast = document.getElementById('toast');
    const specOptions = document.querySelectorAll('.spec-option');
    
    // 样式切换
    styleTabs.forEach(tab => {
      tab.addEventListener('click', function() {
        // 移除所有激活状态
        styleTabs.forEach(t => t.classList.remove('active'));
        productPages.forEach(page => page.classList.remove('active'));
        
        // 设置当前激活状态
        this.classList.add('active');
        const style = this.getAttribute('data-style');
        document.getElementById(style).classList.add('active');
        
        showToast(`已切换到${this.textContent}`);
      });
    });
    
    // 规格选择
    specOptions.forEach(option => {
      option.addEventListener('click', function() {
        // 获取同组的其他选项
        const parent = this.parentElement;
        parent.querySelectorAll('.spec-option').forEach(opt => {
          opt.classList.remove('selected');
        });
        
        // 设置当前选项为选中
        this.classList.add('selected');
        
        showToast(`已选择${this.textContent}`);
      });
    });
    
    // 返回按钮
    backBtn.addEventListener('click', function() {
      showToast('返回商品列表');
    });
    
    // 显示提示
    function showToast(message) {
      toast.textContent = message;
      toast.style.display = 'block';
      
      setTimeout(() => {
        toast.style.opacity = '0';
        setTimeout(() => {
          toast.style.display = 'none';
          toast.style.opacity = '1';
        }, 300);
      }, 2000);
    }
  </script>
</body>
</html>
